import re
# 默认是贪婪的，如果想将贪婪模式变成非贪婪模式 在量词后面加上？
msg = 'abc123abc'

result = re.match(r'abc(\d+？)', msg)
print(result)  # 123

path = '<img class="image_X-V-y" src="http://gips2.baidu.com/it/u=3150002139,2124277596&amp;fm=3028&amp;app=3028&amp;f=JPEG&amp;fmt=auto?w=2048&amp;h=2048" alt="">'
result = re.match(r'<img class="image_X-V-y" src="(.*?)">', path)
print(result)
image_path = result.group(1)
import requests
response = requests.get(image_path)
with open('image.jpg', 'wb') as f:
    f.write(response.content)
